import request from './request';

// ========================== 收藏相关 ==========================

// 创建收藏文件夹
export const addFolders = (data:object) => {  
  return request({
    url: '/articles/folders',
    method: 'post',
    data
  });
};
// 修改收藏文件夹
export const editFolders = (data:any) => {  
  return request({
    url: `/articles/folders/${data.id}`,
    method: 'put',
    data
  });
};
// 删除收藏文件夹
export const delFolders = (id: number | string) => {  
  return request({
    url: `/articles/folders/${id}`,
    method: 'delete'
  });
};
// 获取收藏文件夹列表
export const getFoldersList = (data: object) => {  
  return request({
    url: '/articles/folders',
    method: 'get',
    params:  data
  });
};
// 获取收藏文件夹文章列表
export const getFoldersArtList = (data: any) => {  
  return request({
    url: `/articles/folders/${data.id}/articles`,
    method: 'get',
    params:  data
  });
};
// 导出收藏列表
export const foldersExport = (data: any) => {  
  return request({
    url: '/articles/favorites/export',
    method: 'get',
    params:  data
  });
};


// 收藏文章
export const favorite = (data:any) => {  
  return request({
    url: `/articles/${data.id}/favorite`,
    method: 'post',
    data
  });
};